/**
 * HelloWorldController
 * V 1.0.0
 * 2014/12/3
 *
 * Copyright © 2014 中国电信股份有限公司增�?�业务运营中�? 版权�?�?
 *
 * �?有文字�?�代码资料，版权均属中国电信股份有限公司增�?�业务运营中�?
 * �?有，任何公司或个人未经本司协议授权，不得复制、下载�?�存储或公开
 * 显示。违者本公司将依法追究责任�??
 */
package cn.com.yxw.webapp.controller;


import cn.com.yxw.webapp.pojo.Admin;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by  on 2014/12/3.
 */

public class BaseController {

    static final Logger logger = LoggerFactory.getLogger(BaseController.class);

    /**
     * 返回当前登录用户
     *
     * @return
     */
   public Admin getCurrentUser() {
        Subject currentUser = SecurityUtils.getSubject();
        return (Admin) currentUser.getPrincipal();
    }

    /*@ModelAttribute("basePath")
    public String getBasePath() {
        return ServletActionContext.getRequest().getScheme() + "://" + ServletActionContext.getRequest().getServerName() + ":" + ServletActionContext.getRequest().getServerPort() + ServletActionContext.getRequest().getContextPath();
    }*/
}
